<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<link rel="stylesheet" href="http://localhost/obj/movier/ldf/vmovier/Admin/Tpl/Public/css/inc.css" />
	<link rel="stylesheet" href="http://localhost/obj/movier/ldf/vmovier/Admin/Tpl/Public/css/ico.css" />
	<script type='text/javascript' src='http://localhost/obj/movier/HDPHP/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>

	<script type="text/javascript" src='http://localhost/obj/movier/ldf/vmovier/Admin/Tpl/Public/js/extend.js'></script>
	<script type="text/javascript" src='http://localhost/obj/movier/ldf/vmovier/Admin/Tpl/Article/js/js.js'></script>
	<title>添加文章</title>
	<style type="text/css">
		.form .star{background: url(http://localhost/obj/movier/ldf/vmovier/Admin/Tpl/Public/img/star-no.png);vertical-align:middle;width:90px;height: 14px;}
		.form .star b{background: url(http://localhost/obj/movier/ldf/vmovier/Admin/Tpl/Public/img/star-yes.png);height: 14px;}
	</style>
</head>
<body class="bgwhite-1">
	<div class="Menu">
		<a href="<?php echo U('index');?>"><i class="icon-comment mr3 gray"></i>文章管理</a>
		<a href="<?php echo U('add');?>" class="act"><i class="icon-plus mr3 gray"></i>添加文章</a>
		<a href="<?php echo U('updateCache');?>" class="ajax" actUrl="<?php echo U('index');?>"><i class="icon-refresh mr3 gray"></i>更新缓存</a>
	</div>
	<div class="tabMenu">
		<a href="" class="act">基本信息</a>
		<a href="">详细内容</a>
		<a href="">图片</a>
	</div>
	<form method="post" enctype="multipart/form-data">
		<ul class="tabSub">
			<li class="act">
				<table class="table form">
					<tr>
						<td class="stitle pct15">标题</td>
						<td><input type="text" name="title" class="pct60" /></td>
					</tr>
					<tr>
						<td class="stitle">分类</td>
						<td>
							<select name="cid" class="selected">
								<option value="">请选择文章分类...</option>
								<?php $hd["list"]["c"]["total"]=0;if(isset($cate) && !empty($cate)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($cate));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($cate,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

									<option value="<?php echo $c['cid'];?>"><?php echo $c['_name'];?></option>
								<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							</select>
						</td>
					</tr>
					<tr>
						<td class="stitle">附加属性</td>
						<td>
							<?php $hd["list"]["t"]["total"]=0;if(isset($tip) && !empty($tip)):$_id_t=0;$_index_t=0;$lastt=min(1000,count($tip));
$hd["list"]["t"]["first"]=true;
$hd["list"]["t"]["last"]=false;
$_total_t=ceil($lastt/1);$hd["list"]["t"]["total"]=$_total_t;
$_data_t = array_slice($tip,0,$lastt);
if(count($_data_t)==0):echo "";
else:
foreach($_data_t as $key=>$t):
if(($_id_t)%1==0):$_id_t++;else:$_id_t++;continue;endif;
$hd["list"]["t"]["index"]=++$_index_t;
if($_index_t>=$_total_t):$hd["list"]["t"]["last"]=true;endif;?>

								<label for="s<?php echo $hd['list']['t']['index'];?>" class="mr10">
									<input id="s<?php echo $hd['list']['t']['index'];?>" type="radio" name="tid" value="<?php echo $t['tid'];?>" <?php if($hd['list']['t']['first']){?> checked="" <?php }?>/> <span class="<?php echo $t['styleName'];?>"><?php echo $t['tname'];?></span>
								</label>
							<?php $hd["list"]["t"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
						</td>
					</tr>
					<tr>
						<td class="stitle">属性</td>
						<td>
							<label for="f1" class="mr10">
								<input id="f1" type="checkbox" name="flag[]" value="热门"/> <span class="">热门</span>
							</label>
							<label for="f2" class="mr10">
								<input id="f2" type="checkbox" name="flag[]" value="置顶"/> <span class="">置顶</span>
							</label>
							<label for="f3" class="mr10">
								<input id="f3" type="checkbox" name="flag[]" value="推荐"/> <span class="">推荐</span>
							</label>
						</td>
					</tr>
					<tr>
						<td class="stitle">标签</td>
						<td><input type="text" name="tags" class="pct80" placeholder="如:百度,淘宝,京东...(用英文,号隔开)" /></td>
					</tr>
					<tr>
						<td class="stitle">星级</td>
						<td>
							<input type="button" class="btn bgwhite" value="─" id="reduceStar" />
							<input type="text" name="star" class="pct5" value="5" />
							<input type="button" class="btn bgwhite" value="┼" id="addStar" />
							<span class="dib star">
								<b class="dib" style="width:100%"></b>
							</span>
						</td>
						<script type="text/javascript">
							//响应 + - 按钮
							$('#addStar').click(function(){
								var step=0.5;
								$('input[name=star]').val(Number($('input[name=star]').val())+step);
								showStar();
							})
							$('#reduceStar').click(function(){
								var step=0.5;
								$('input[name=star]').val(Number($('input[name=star]').val())-step);
								showStar();
							})
							$('input[name=star]').blur(function(){
								showStar();
							})
							function showStar(){
								var obj=$('input[name=star]'),
									n=Math.round(obj.val()*100)/100 ;
								if(n>5) {
									obj.val(5);
									n=5;
								}
								if(n<0) {
									obj.val(0);
									n=0;
								}
								var b = Math.round((n/5)*100)/100*100;
								$('.star b').animate({'width':b+'%'});
							}
						</script>
					</tr>
					<tr>
						<td class="stitle">关键字</td>
						<td><input type="text" name="keywords" class="pct70" placeholder="关键字" /></td>
					</tr>
					<tr>
						<td class="stitle">描述</td>
						<td>
							<textarea name="description" cols="10" rows="2"  class="pct80" placeholder="最好80-120个字" ></textarea>
						</td>
					</tr>
					<tr>
						<td class="stitle">视频链接网址</td>
						<td><input type="text" name="vurl" class="pct60" placeholder="视频真实链接地址。。。" /></td>
					</tr>
					<tr>
						<td class="stitle">视频真实地址</td>
						<td><input type="text" name="videoUrl" class="pct80" placeholder="视频真实链接地址。。。" /></td>
					</tr>
			</table>
			</li>
			<li>
				<table class="table form">
					<tr>
						<td class="stitle pct10">内容</td>
						<td><script charset="utf-8" src="http://localhost/obj/movier/HDPHP/hdphp/Extend/Org/Keditor/kindeditor-all-min.js"></script>
            <script charset="utf-8" src="http://localhost/obj/movier/HDPHP/hdphp/Extend/Org/Keditor/lang/zh_CN.js"></script>
        <textarea id="hd_content" name="content"></textarea>
        <script>
        var options_content = {
        filterMode : false
                ,id : "editor_id"
        ,width : "100%"
        ,height:"300px"
                ,formatUploadUrl:false
        ,allowFileManager:false
        ,allowImageUpload:true
        ,afterBlur: function(){this.sync();}
        ,uploadJson : "http://localhost/obj/movier/index.php?a=Admin&c=Article&m=keditor_upload&g=vmovier&water=1&uploadsize=2000000&maximagewidth=false&maximageheight=false&PHPSESSID=bum0jod6ar64upoda5uvhl2cb0"
        };var hd_content;
        KindEditor.ready(function(K) {
                    hd_content = KindEditor.create("#hd_content",options_content);
        });
        </script>
        </td>
					</tr>
				</table>
			</li>
			<li>
				<table class="table form" id="huodongtable">
					<tr>
						<td class="stitle">图片</td>
						<td><input type="file" class="bgwhite" name="pic" /></td>
					</tr>
					<tr>
						<td class="stitle">活动</td>
						<td>
							<label for="huodong" class="ml5">
								<input value="1" id="huodong" type="checkbox" name="huodong" /> 作为活动 <span class="gray ml10">勾选之后首页幻灯片变为活动的幻灯片,切展示图片宽高发生改变</span>
							</label>
						</td>
					</tr>
					<tr>
						<td class="stitle">添加幻灯片</td>
						<td>
							<label for="sli" class="ml5">
								<input value="1" id="sli" type="checkbox" name="slide" /> 作为幻灯片 / 轮播图 图片
							</label>
						</td>
					</tr>
					<tr id="slideTr">
						<td class="stitle">幻灯片图片</td>
						<td><input type="file" class="bgwhite" name="big" disabled="" /></td>
					</tr>
				</table>

				<table id="huodongwrap">
					<tbody id="hdBody">
					<tr>
						<td class="stitle">活动时间</td>
						<td> <input type="text" class="ml5 pct30" name="hdtime" /> </td>
					</tr>
					<tr>
						<td class="stitle">活动地点</td>
						<td> <input type="text" class="ml5 pct20" name="hdplace" /> </td>
					</tr>
					</tbody>
				</table>
				<script type="text/javascript">
				//首页幻灯
					$('#sli').attr('checked')?$('[name=big]').attr('disabled',false):$('[name=big]').attr('disabled',true);
					$('#sli').click(function(){
						$(this).attr('checked')?$('[name=big]').attr('disabled',false):$('[name=big]').attr('disabled',true);
					})
				//活动 勾选活动出现input
				var hdCont = $('#huodongwrap').clone();
				$('#huodongwrap').remove();
				$('#huodong').click(function(event) {
					$(this).attr('checked')?$('#huodongtable').append(hdCont.html()):$('#hdBody').remove();
				});
				
				</script>
			</li>
		</ul>
		<div class="fixBottom"><input value="确定操作" type="submit" class="m10 bgblack btn f18" /></div>
	</form>

	<script type="text/javascript">
		$('form').validate({
			// 验证规则
			title: {
				rule: {
					required: true
				},
				success: ' 操作成功 '
			}
		})
	</script>
</body>
</html>